package com.niodata.dp.core;

public class Constants {

  public static final String PUBLIC_GROUP_NAME = "All";
  /**
   * LDAP存储的组名前缀.
   */
  public static final String LDAP_GROUP_PREFIX = "";
  //    "group_" + DpConfiguration.getConfiguration().getAppId() + "_";

  /**
   * 用户内置hdfs用户前缀.
   */
  public static final String HDFS_USER_PREFIX = "";
  //    "hdfs_u_" + DpConfiguration.getConfiguration().getAppId() + "_";

  /**
   * 组内置hdfs owner用户 前缀.
   */
  public static final String HDFS_GROUP_OWNER_USER_PREFIX = "hdfs_w_";

  /**
   * GROUP内置DB只读权限的用户名前缀.
   */
  public static final String HDFS_READ_USER_PREFIX = "hdfs_r_";


  public static final String PLUGIN_VERSION_PATTERN = ".+-.+";

  public static final String PRESTO_JDBC_CONNECTION_URL = "connection-url";
  public static final String PRESTO_JDBC_CONNECTION_USER = "connection-user";
  public static final String PRESTO_JDBC_CONNECTION_PASSWORD = "connection-password";
  public static final String PRESTO_HIVE_CONFIG_RES = "hive.config.resources";
  public static final String PRESTO_HIVE_METASTORE_URIS = "hive.metastore.uri";
  public static final String PRESTO_HIVE_CONNECTION_USER = "connection.user";
  public static final String PRESTO_HIVE_METASTORE_AUTH_TYPE = "hive.metastore.authentication.type";
  public static final String PRESTO_HIVE_METASTORE_SERVICE_PRINCIPAL
        = "hive.metastore.service.principal";
  public static final String PRESTO_HIVE_METASTORE_CLIENT_PRINCIPAL
        = "hive.metastore.client.principal";
  public static final String PRESTO_HIVE_METASTORE_CLIENT_KEYTAB = "hive.metastore.client.keytab";
  public static final String PRESTO_HIVE_HDFS_AUTH_TYPE = "hive.hdfs.authentication.type";
  public static final String PRESTO_HIVE_HDFS_PRINCIPAL = "hive.hdfs.presto.principal";
  public static final String PRESTO_HIVE_HDFS_KEYTAB = "hive.hdfs.presto.keytab";
  public static final String PRESTO_MONGODB_SEEDS = "mongodb.seeds";
  public static final String PHOENIX_CONNECTION_URL = "phoenix.connection-url";
  public static final String PHOENIX_CONFIG_RESOURCES = "phoenix.config.resources";
  public static final String PHOENIX_SCHEMA_MAPPING_ENABLED =
        "phoenix.schema.isNamespaceMappingEnabled";
  //预定义色标
  public static final String PRE_COLOR_SCALE_MAP = "preDefinedColorScaleMap";

  //脚本执行返回类型http header key
  public static final String SCRIPT_EXEC_HEADER_KEY = "X-Return-Type";
  public static final String VARIABLE_TABLE_NAME = "variables";
  public static final String CREATE_VARIABLES_TABLE_FORMAT = String.format(
        "CREATE TABLE IF NOT EXISTS %%s.%s(name VARCHAR(64) PRIMARY KEY, type VARCHAR(32),"
              + " value CLOB, comment VARCHAR(64))", VARIABLE_TABLE_NAME);

  public static final String CREATE_SCHEMA_FORMAT = "CREATE SCHEMA IF NOT EXISTS %s";
  public static final String DROP_TABLE_FORMAT = "DROP TABLE IF EXISTS %s.%s CASCADE";
  public static final String DROP_SCHEMA_FORMAT = "DROP SCHEMA IF EXISTS %s CASCADE";

  public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";

  public static final String H2_SCHEMA_NAME_FORMAT = "schema_%s";

  public static final String REST_DATA_ENV_KEY = "JSON_STRING";

  public static String MYSQL_CREATE_TEMPLATE = "CREATE DATABASE  %s\n"
        + "  DEFAULT CHARACTER SET UTF8\n"
        + "  COLLATE UTF8_GENERAL_CI";

  public static String MYSQL_CREATE_DATABASE_TEMPLATE = "CREATE DATABASE IF NOT EXISTS %s\n"
        + "  DEFAULT CHARACTER SET UTF8\n"
        + "  COLLATE UTF8_GENERAL_CI";


  public static String POSTGRESQL_CREATE_TEMPLATE = "CREATE SCHEMA %s";

  public static String EXECUTE_AS_USER = "execute-as-user";

  public static String DEFAULT_DW_TEMP_DIR = "./temp";

  public static String DEFAULT_DW_TEMP_CSVOREXCLE_DIR = "./temp/csvorexcle";

  public static String DEFAULT_DW_EXPORT_DIR = "EXPORT_FILES";

  public static Long DEFAULT_DW_MAX_ASYNC_DATA_EXPORT_LIMIT = 1000000L;

  public static String SQLSERVER_CREATE_DATBASE_TEMPLATE = "CREATE DATABASE  %s\n";

  public static String ORACLE_CREATE_DATBASE_TEMPLATE = "CREATE DATABASE %s\n";

  public static String PHOENIX_CREATE_SCHEMA_TEMPLATE = "CREATE SCHEMA IF NOT EXISTS %s\n";

}
